package com.ruoyi.cms.enums;

/**
 * 平台枚举类
 *
 * @author Lorry
 * @since 2020-04-24 21:19
 **/
public enum PlatformEnum {
    /**
     * 枚举类
     */
    WX(1, "weixin"),
    TT(2, "toutiao"),
    ;

    PlatformEnum(Integer type, String platform) {
        this.type = type;
        this.platform = platform;
    }

    private Integer type;
    private String platform;

    public static PlatformEnum getPlatform(int type) {
        for (PlatformEnum platform : PlatformEnum.values()) {
            if (platform.getType() == type) {
                return platform;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public String getPlatform() {
        return platform;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }
}
